package com.qianfeng.smartplatform.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;
import org.springframework.util.StringUtils;

@Data
@ToString
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class SysCategory implements CheckNull {

  private Long cId;
  private String categoryName;
  private String txCommand;
  private String rxCommand;
  private String commandName;
  private Long status;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private java.util.Date createTime;
  private String createBy;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
  private java.util.Date updateTime;
  private String updateBy;


  @Override
  public boolean isEmpty(CheckType type) {
    switch (type) {

      case ADD: //添加的时候只需要判断有没有传递分类名字
        return !StringUtils.hasText(categoryName);
    }


    return false;
  }
}
